<form method="post" action="#">
    <h3>Biodata</h3>
    <font>Nama</font>
    <input type="text" name="txtNama" id="txtNama" value="<?= @$alumni->alumninama ?>"/><br/>
    <font>Propinsi</font>
    <select name="txtPropinsidomisili" id="txtPropinsidomisili">
        <option value="">Select</option>
        <? foreach (getPropinsi() as $k => $v) { ?>
            <option value="<?= $v->propinsiid ?>"<?= @$alumni->alumnipropinsidomisili == $v->propinsiid ? ' selected="selected"' : "" ?>><?= $v->propinsinama ?></option>
        <? } ?>
    </select><br/>
    <font>Kota</font>
    <select name="txtKotadomisili" id="txtKotadomisili">
        <option value="">Select</option>
        <? foreach (getKabupaten(@$alumni->alumnipropinsidomisili) as $k => $v) { ?>
            <option value="<?= $v->kabupatenid ?>"<?= @$alumni->alumnikotadomisili == $v->kabupatenid ? ' selected="selected"' : "" ?>><?= $v->kabupatennama ?></option>
        <? } ?>
    </select><br/>
    <font>Alamat</font>
    <input type="text" name="txtAlamatdomisili" id="txtAlamatdomisili" value="<?= @$alumni->alumnialamatdomisili ?>"/><br/>
    <font>Contact</font>
    <input type="text" name="txtContact" id="txtContact" value="<?= @$alumni->alumnicontact ?>"/><br/>
    <font>Email</font>
    <input type="text" name="txtEmail" id="txtEmail" value="<?= @$alumni->alumniemail ?>"/><br/>
    <font>Jenis Kelamin</font>
    <select name="ddJenkel" id="ddJenkel">
        <option value="L"<?= @$alumni->alumnijenkel == "L" ? ' selected="selected"' : "" ?>>Laki-laki</option>
        <option value="P"<?= @$alumni->alumnijenkel == "P" ? ' selected="selected"' : "" ?>>Perempuan</option>
    </select><br/>
    <font>Status</font>
    <input type="text" name="txtStatus" id="txtStatus" value="<?= @$alumni->alumnistatus ?>"/><br/>
    <font>Hubungan</font>
    <select name="ddHubungan" id="ddHubungan">
        <option value="ANAK" <?= @$alumni->alumnitype == "ANAK" ? ' selected="selected"' : "" ?>>Anak</option>
        <option value="ISTRI" <?= @$alumni->alumnitype == "ISTRI" ? ' selected="selected"' : "" ?>>Istri</option>
        <option value="ORTU" <?= @$alumni->alumnitype == "ORTU" ? ' selected="selected"' : "" ?>>Orang Tua</option>
        <option value="SAUDARA" <?= @$alumni->alumnitype == "SAUDARA" ? ' selected="selected"' : "" ?>>Saudara</option>
        <option value="SUAMI" <?= @$alumni->alumnitype == "SUAMI" ? ' selected="selected"' : "" ?>>Suami</option>
    </select><br/>
    <input type="submit" value="Simpan"/><a href="<?= base_url() ?>kerabat/detail/<?=$this->uri->segment(3)?>">Batal</a>
</form>

<script>
    jQuery(document).ready(function($){
        $('#txtPropinsiasal').change(function(){
            $('#txtKotaasal').empty();
            $.post('<?= base_url() . "region/kabupaten" ?>', {id:$('#txtPropinsiasal').val()}, function(data) {
                if(data){
                    var datajs = $.parseJSON(data);
                    $('<option value="">Select</option>').appendTo("#txtKotaasal");
                    $.each(datajs, function(key, value){
                        $("<option value='"+value.kabupatenid+"'>"+value.kabupatennama+"</option>").appendTo("#txtKotaasal");
                    });
                }
            });
        });
        $('#txtPropinsidomisili').change(function(){
            $('#txtKotadomisili').empty();
            $.post('<?= base_url() . "region/kabupaten" ?>', {id:$('#txtPropinsidomisili').val()}, function(data) {
                if(data){
                    var datajs = $.parseJSON(data);
                    $('<option value="">Select</option>').appendTo("#txtKotadomisili");
                    $.each(datajs, function(key, value){
                        $("<option value='"+value.kabupatenid+"'>"+value.kabupatennama+"</option>").appendTo("#txtKotadomisili");
                    });
                }
            });
        });
    });
	
</script>